package b;

//p192 Iterator遍历集合中的元素

import java.util.ArrayList;
import java.util.Iterator;
public class demo3 {
    public static void main(String[] args) {
        ArrayList list = new ArrayList();
        list.add("枕头");
        list.add("被套");
        list.add("床单");
        Iterator it = list.iterator();
        while (it.hasNext())
            System.out.println(it.next());
    }
}
